package im

import (
    //"fmt"
	"dhfshop/controllers/base"
	"thirdpaysdk/api/allinpay"
	"dhfshop/domain/im"
	//"dhfshop/models/isv"
	"github.com/astaxie/beego"
)

type AllinPayController struct {
	base.BaseController
}

func (this *AllinPayController) AllinPayNotify() {
	notifyData := this.Ctx.Input.RequestBody
	beego.Debug("AllinPayNotify notifyData:", string(notifyData))
	var v allinpay.AllinpayMsg
	this.ParseForm(&v)
	reqMap, _:= allinpay.AllinpayFormNotify(v)
	reqMap["LocalKind"] = "ALLINPAY_NOTIFY"
	//reqMap["attach"] = "ESHOP_ORDER_PAY"    //需要修改
	reqMap["attach"] = reqMap["trxreserved"]  //
	imlayer.PushMsgSvrIns.PushDao <- &reqMap
	this.Ctx.WriteString("success")
	return
}
